﻿using RpcCentral.Model;
using RpcService.Model;
using SqlSugarHelper;

namespace RpcCentral.DAL.Repository
{
    internal class RpcMerConfigDAL : IRpcMerConfigDAL
    {
        private IRepository<RpcMerConfig> _Db;
        public RpcMerConfigDAL(IRepository<RpcMerConfig> db)
        {
            _Db = db;
        }
        public MerConfig GetConfig(long rpcMerId, long sysTypeId)
        {
            return this._Db.Get(c => c.RpcMerId == rpcMerId && c.SystemTypeId == sysTypeId, c => new MerConfig
            {
                IsolateLevel = c.IsolateLevel,
                IsRegionIsolate = c.IsRegionIsolate
            });
        }
    }
}
